package cn.sowfin.service.impl;

import cn.sowfin.dao.NewUserDao;
import cn.sowfin.entity.User;
import cn.sowfin.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("userService")
public class UserServiceImpl implements UserService {


    @Autowired
    NewUserDao newUserDao;


    @Override
    public void create(User user) {
        newUserDao.insert(user);
    }

    @Override
    public void remove(Integer id) {
        newUserDao.delete(id);
    }

    @Override
    public void save(User user) {
        newUserDao.update(user);
    }

    @Override
    public List<User> list() {
        return newUserDao.findAll();
    }

    @Override
    public User get(Integer id) {
        return newUserDao.get(id);
    }
}
